package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.dubbo.mappers.AnnouncementMapper;
import com.tanhua.model.domain.Announcement;
import com.tanhua.service.AnnouncementApi;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author げっしょく
 * @date 2021/10/30
 */
@DubboService
public class AnnouncementApiImpl implements AnnouncementApi {

    @Autowired
    private AnnouncementMapper announcementMapper;
    @Override
    public List<Announcement> slectAll(Integer page, Integer pagesize) {

        Page p = new Page<>(page, pagesize);
        Page page1 = announcementMapper.selectPage(p, null);
        List<Announcement> list = announcementMapper.selectAll(p);

        return list;
    }
}
